<!DOCTYPE html> 
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0, user-scalable=0" name="viewport" />        
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" /> 
<meta content="telephone=no" name="format-detection" /> 
<title>选择部门</title>
<link rel="stylesheet" href="css/selectDep.css">
</head>
<body>
<div class="container">
	<div class="search-bar">
		<div class="search-inner">
			<img src="images/search1@2x.png" alt="">
			<input type="text" placeholder="搜索营业部门">
		</div>
	</div>
	<div class="dep-wrap">
		<div class="sub-wrap">
			<div class="title">A</div>
			<div class="list-wrap">
				<div class="list" partId="111">安庆市黄兴营业部</div>
				<div class="list" partId="222">安庆市黄兴营业部</div>
			</div>
		</div>

		<div class="sub-wrap">
			<div class="title">A</div>
			<div class="list-wrap">
				<div class="list">安庆市黄兴营业部</div>
				<div class="list">安庆市黄兴营业部</div>
			</div>
		</div>

		<div class="sub-wrap">
			<div class="title">A</div>
			<div class="list-wrap">
				<div class="list">安庆市黄兴营业部</div>
				<div class="list">安庆市黄兴营业部</div>
			</div>
		</div>

		<div class="sub-wrap">
			<div class="title">A</div>
			<div class="list-wrap">
				<div class="list">安庆市黄兴营业部</div>
				<div class="list">安庆市黄兴营业部</div>
			</div>
		</div>

		<div class="sub-wrap">
			<div class="title">A</div>
			<div class="list-wrap">
				<div class="list">安庆市黄兴营业部</div>
				<div class="list">安庆市黄兴营业部</div>
			</div>
		</div>

		<div class="sub-wrap">
			<div class="title">A</div>
			<div class="list-wrap">
				<div class="list">安庆市黄兴营业部</div>
				<div class="list">安庆市黄兴营业部</div>
			</div>
		</div>

		<div class="sub-wrap">
			<div class="title">A</div>
			<div class="list-wrap">
				<div class="list">安庆市黄兴营业部</div>
				<div class="list">安庆市黄兴营业部</div>
			</div>
		</div>
	</div>
</div>
<script src="js/build/lib.js" type="text/javascript"></script>
<script>
var selectDep = {
	init: function(){
		// 兼容按压效果
		document.body.addEventListener('touchstart', function () { //...空函数即可
		});
	},
	events: function(){
		// 搜索条点击
		$('.search-bar').hammer().on('tap',function(){
			window.location = "searchDep.html";
		});

		// 选择部门
		$('.dep-wrap').delegate('.list','click',function(){
			var _partName = $(this).text(),
				_partId = $(this).attr('partId');
				console.log(_partId,_partName);

			// 将选择的部门放到sesseion里面
			sessionStorage.setItem("partId", _partId); 
			sessionStorage.setItem("partName", _partName); 
			setTimeout(function(){
				window.location.href = "select.html";
			},320);
		});


	},
	run: function(){
		this.init();
		this.events();
	}
};
selectDep.run();
</script>

</body>
</html>